package org.cangku.controller;

import org.cangku.dao.ShopInfoDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/shopinfo")
public class ShopInfoController {
    @Autowired
    private ShopInfoDao shopInfoDao;

    /*模糊分页查询*/
    @RequestMapping("/query")
    @ResponseBody
    public Map<String,Object> queryMoHuFenYe(String name, int brandid, int offset, int limit){
        Map<String,Object> map = new HashMap<>();

        map.put("rows",shopInfoDao.queryBytj(name,brandid,offset,limit));
        map.put("total",shopInfoDao.getByNameCount(name,brandid));
        return map;
    }
}
